package com.member.shop.service.impl;

import java.util.Arrays;
import java.util.List;

import com.member.common.utils.DateUtils;

import javax.annotation.Resource;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import com.member.shop.mapper.SysBizActivityDealerMapper;
import com.member.shop.domain.SysBizActivityDealer;
import com.member.shop.service.ISysBizActivityDealerService;

/**
 * 参与活动店铺Service业务层处理
 *
 * @author lixinchen
 * @date 2024-11-09
 */
@Service
public class SysBizActivityDealerServiceImpl extends ServiceImpl<SysBizActivityDealerMapper, SysBizActivityDealer> implements ISysBizActivityDealerService {
    @Resource
    private SysBizActivityDealerMapper sysBizActivityDealerMapper;

    /**
     * 查询参与活动店铺
     *
     * @param id 参与活动店铺主键
     * @return 参与活动店铺
     */
    @Override
    public SysBizActivityDealer selectSysBizActivityDealerById(Long id) {
        return sysBizActivityDealerMapper.selectById(id);
    }

    /**
     * 查询参与活动店铺列表
     *
     * @param queryWrapper 参与活动店铺
     * @return 参与活动店铺
     */
    @Override
    public List<SysBizActivityDealer> selectSysBizActivityDealerList(LambdaQueryWrapper<SysBizActivityDealer> queryWrapper) {
        return sysBizActivityDealerMapper.selectList(queryWrapper);
    }

    /**
     * 新增参与活动店铺
     *
     * @param sysBizActivityDealer 参与活动店铺
     * @return 结果
     */
    @Override
    public int insertSysBizActivityDealer(SysBizActivityDealer sysBizActivityDealer) {
        sysBizActivityDealer.setCreateTime(DateUtils.getNowDate());
        return sysBizActivityDealerMapper.insert(sysBizActivityDealer);
    }

    /**
     * 修改参与活动店铺
     *
     * @param sysBizActivityDealer 参与活动店铺
     * @return 结果
     */
    @Override
    public int updateSysBizActivityDealer(SysBizActivityDealer sysBizActivityDealer) {
        sysBizActivityDealer.setUpdateTime(DateUtils.getNowDate());
        return sysBizActivityDealerMapper.updateById(sysBizActivityDealer);
    }

    /**
     * 批量删除参与活动店铺
     *
     * @param ids 需要删除的参与活动店铺主键
     * @return 结果
     */
    @Override
    public int deleteSysBizActivityDealerByIds(Long[] ids) {
        return sysBizActivityDealerMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除参与活动店铺信息
     *
     * @param id 参与活动店铺主键
     * @return 结果
     */
    @Override
    public int deleteSysBizActivityDealerById(Long id) {
        return sysBizActivityDealerMapper.deleteById(id);
    }

    @Override
    public List<SysBizActivityDealer> selectSysBizActivityDealerList(SysBizActivityDealer sysBizActivityDealer) {
        return sysBizActivityDealerMapper.selectSysBizActivityDealerList(sysBizActivityDealer);
    }
}
